OTSndDisconnect
Tears down an open connection (abortive disconnect) or rejects an incoming connection request.C INTERFACE
OSStatus OTSndDisconnect(EndpointRef ref, TCall* call);C++ INTERFACE
OSStatus TEndpoint::SndDisconnect(TCall* call);PARAMETERS
ref
- The endpoint reference for the endpoint tearing down the connection or rejecting the connection request.
call
- A pointer to a
TCall
structure (page 3-62) that specifies the connection to be torn down or rejected and specifies data sent with the disconnection request if the endpoint supports sending such data.DESCRIPTION
There are two functions that you can use to tear down a connection:OTSndDisconnect
for an abortive disconnect, orOTSndOrderlyDisconnect
for an orderly disconnect. It is recommended that you use theOTSndOrderlyDisconnect
function for tearing down a connection whenever possible and that you use theOTSndDisconnect
function only for rejecting incoming connection requests.If the endpoint is in asynchronous mode, the
OTSndDisconnect
function returns immediately with a result ofkOTNoError
to indicate that the disconnection process has begun and that your notifier function will be called when the process completes.When the connection has been broken, the provider issues a
T_DISCONNECTCOMPLETE
event. If you have installed a notifier function, Open Transport calls your notifier and passes this event in thecode
parameter. Thecookie
parameter contains thecall
parameter. If you have not installed a notifier function, you cannot determine when this function completes.COMPLETION EVENT CODES
T_DISCONNECTCOMPLETE
0x20000005 The OTSndDisconnect
function has completed. Thecookie
parameter contains thecall
parameter.VALID STATES
T_DATAXFER
,T_OUTCON
,T_OUTREL
,T_INREL
(andT_INCON
, when two or more incoming connection requests are outstanding)SEE ALSO
To acknowledge an abortive disconnect, you call theOTRcvDisconnect
function (described next).You use the
TCall
structure (page 3-62) to describe the connection being torn down or rejected.You use the
OTListen
function (page 3-125) to listen for a disconnection request.You can examine the
discon
field of theTEndpointInfo
structure (page 3-48) for the endpoint to determine whether the endpoint supports sending data during the disconnection and to find out the maximum size of such data.For information on how to use this function with a TCP/IP protocol, see page 8-19 in the TCP/IP chapter.
For information on how to use this function with AppleTalk protocols, see page 13-12 in the ADSP chapter and page 15-11 in the PAP chapter.
For information on abortive and orderly disconnects, see "Terminating a Connection," beginning on page 3-30.